package cn.yangliu.nacos.gateway.remote;

import cn.yangliu.nacos.comm.JsonResult;
import cn.yangliu.nacos.gateway.model.Oauth2TokenInfo;
import cn.yangliu.nacos.gateway.remote.hystrix.Oauth2Fallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * The interface Oauth 2 service.
 *
 * @author 问道于盲
 * @date 2019 -12-14
 */
@FeignClient(name = "oauth2",fallback = Oauth2Fallback.class)
public interface Oauth2Service {

    /**
     * check_token
     *
     * @param token the token
     * @return json result
     */
    @PostMapping("/oauth/check_token")
    JsonResult<Oauth2TokenInfo> checkToken(@RequestParam("token") String token);
}
